'''【bug】混了点分'''
def method(n, m, nums):
    dis = []  # <i, d>
    for i, d in enumerate(nums):
        dis.append([i, d])
    dis.sort(key=lambda x:x[1])
    # print(dis)

    ans = []
    count = m - n + 1  # 需要补充的边数
    front = [0, 0]  # 上一层的节点号，层号
    nodes = [[]]
    for i, node in enumerate(dis):
        if node[1] == front[1] + 1:
            ans.append([node[0], front[0]])
        elif node[1] == front[1] + 2:
            front = dis[i - 1]
            ans.append([node[0], front[0]])
            nodes.append([])
        # 中间缺了层
        elif node[1] != 0:
            return -1

        while count > 0:
            # print(node, nodes)
            # count -= 1
            # 和上层首以外，的所有结点连接
            level = front[1]
            for fno in nodes[level][1:]:
                if count <= 0: break
                ans.append([node[0], fno[0]])
                count -= 1
            # 和本层所有结点连接
            if level + 1 >= len(nodes):
                break 
            for fno in nodes[level + 1][1:]:
                if count <= 0: break
                ans.append([node[0], fno[0]])
                count -= 1

        nodes[-1].append(node)

    if count > 0:
        return -1
    return ans


n, m = map(int, input().split())
nums = [int(x) for x in input().split()]
ans = method(n, m, nums)
if ans == -1:
    print(-1)
else:
    for an in ans:
        print(an[0] + 1, an[1] + 1)
